<?php
/*
 * @Author: lokei
 * @Date: 2022-09-28 20:55:13
 * @LastEditors: lokei
 * @LastEditTime: 2022-12-31 13:12:10
 * @Description: 
 */
$router->group(['prefix' => env('ROUTER_PREFIX') . 'api'], function () use ($router) {
	
	$router->group(['prefix' => 'conf/init'], function () use ($router) {
		// 获取初始化设置
		$router->get('get', [
			'as' => 'getInitConf', 'uses' => '\App\Http\Controllers\Platform\Conf\InitController@get'
		]);
	});
	
	/**平台接口 */
	// 设置
	$router->group(['prefix' => 'conf'], function () use ($router) {
		// conf
		$router->get('get', [
			'as' => 'getConf', 'uses' => '\App\Http\Controllers\Platform\Conf\CommonController@get'
		]);
		$router->post('update', [
			'as' => 'updateConf', 'uses' => '\App\Http\Controllers\Platform\Conf\CommonController@update'
		]);
		$router->post('commercial/update', [
			'as' => 'updateCommercialConf', 'uses' => '\App\Http\Controllers\Platform\Conf\CommercialController@update'
		]);
		
		// 微信公众号设置
		$router->get('mp/get', [
			'as' => 'getConf', 'uses' => '\App\Http\Controllers\Platform\Conf\MpController@get'
		]);
		$router->post('mp/update', [
			'as' => 'updateConf', 'uses' => '\App\Http\Controllers\Platform\Conf\MpController@update'
		]);
		
		// miniapp conf
		$router->get('miniapp/get', [
			'as' => 'getConf', 'uses' => '\App\Http\Controllers\Platform\Conf\MiniappController@get'
		]);
		$router->post('miniapp/update', [
			'as' => 'updateConf', 'uses' => '\App\Http\Controllers\Platform\Conf\MiniappController@update'
		]);
		
		// qiwei conf
		$router->get('qiwei/get', [
			'as' => 'getConf', 'uses' => '\App\Http\Controllers\Platform\Conf\QiweiController@get'
		]);
		$router->post('qiwei/update', [
			'as' => 'updateConf', 'uses' => '\App\Http\Controllers\Platform\Conf\QiweiController@update'
		]);
		
		// alipay conf
		$router->get('alipay/get', [
			'as' => 'getConf', 'uses' => '\App\Http\Controllers\Platform\Conf\AlipayController@get'
		]);
		$router->post('alipay/update', [
			'as' => 'updateConf', 'uses' => '\App\Http\Controllers\Platform\Conf\AlipayController@update'
		]);
		
	});
	// 上传
	$router->group(['prefix' => 'upload'], function () use ($router) {
		// upload
		$router->post('file', [
			'as' => 'uploadFile', 'uses' => '\App\Http\Controllers\Platform\Upload\FileController@upload'
		]);
		$router->post('image', [
			'as' => 'uploadImage', 'uses' => '\App\Http\Controllers\Platform\Upload\ImageController@upload'
		]);
		
	});
	// 标签
	$router->group(['prefix' => 'tag'], function () use ($router) {
		// tag
		$router->get('list', [
			'as' => 'tagList', 'uses' => '\App\Http\Controllers\Platform\Tag\TagController@list'
		]);
		$router->get('ofScene', [
			'as' => 'tagofScene', 'uses' => '\App\Http\Controllers\Platform\Tag\TagController@ofScene'
		]);
		$router->post('create', [
			'as' => 'createTag', 'uses' => '\App\Http\Controllers\Platform\Tag\TagController@create'
		]);
		$router->post('update', [
			'as' => 'updateTag', 'uses' => '\App\Http\Controllers\Platform\Tag\TagController@update'
		]);
		$router->post('delete', [
			'as' => 'deleteTag', 'uses' => '\App\Http\Controllers\Platform\Tag\TagController@delete'
		]);
		
	});
	// 分类
	$router->group(['prefix' => 'type'], function () use ($router) {
		// type
		$router->get('ofMode', [
			'as' => 'typeOfMode', 'uses' => '\App\Http\Controllers\Platform\Type\TypeController@ofMode'
		]);
		$router->get('ofModeRoot', [
			'as' => 'typeOfModeRoot', 'uses' => '\App\Http\Controllers\Platform\Type\TypeController@ofModeRoot'
		]);
		$router->get('ofPre', [
			'as' => 'typeOfPre', 'uses' => '\App\Http\Controllers\Platform\Type\TypeController@ofPre'
		]);
		$router->post('create', [
			'as' => 'createType', 'uses' => '\App\Http\Controllers\Platform\Type\TypeController@create'
		]);
		$router->post('update', [
			'as' => 'updateType', 'uses' => '\App\Http\Controllers\Platform\Type\TypeController@update'
		]);
		$router->post('delete', [
			'as' => 'deleteType', 'uses' => '\App\Http\Controllers\Platform\Type\TypeController@delete'
		]);
		
	});

	// 打印
	$router->group(['prefix' => 'printer'], function () use ($router) {
		// printer
		$router->get('ofStore', [
			'as' => 'printerOfStore', 'uses' => '\App\Http\Controllers\Platform\Print\PrinterController@ofStore'
		]);
		$router->post('create', [
			'as' => 'createPrinter', 'uses' => '\App\Http\Controllers\Platform\Print\PrinterController@create'
		]);
		$router->post('update', [
			'as' => 'updatePrinter', 'uses' => '\App\Http\Controllers\Platform\Print\PrinterController@update'
		]);
		$router->post('delete', [
			'as' => 'deletePrinter', 'uses' => '\App\Http\Controllers\Platform\Print\PrinterController@delete'
		]);
		
	});
	$router->post('print', [
		'as' => 'print', 'uses' => '\App\Http\Controllers\Platform\Print\PrintController@print'
	]);

	// 统计
	$router->group(['prefix' => 'statistic'], function () use ($router) {
		// printer
		$router->get('platform/all', [
			'as' => 'allStatistic', 'uses' => '\App\Http\Controllers\Platform\Statistic\PlatformController@all'
		]);
	});

	// 建议
	$router->group(['prefix' => 'suggest', 'middleware' => 'auth'], function () use ($router) {
		// suggest
		$router->post('submit', [
			'as' => 'submitSuggest', 'uses' => '\App\Http\Controllers\Platform\Suggest\SuggestController@submit'
		]);
		$router->get('ofMy', [
			'as' => 'ofMySuggest', 'uses' => '\App\Http\Controllers\Platform\Suggest\SuggestController@ofMy'
		]);
	});
	$router->group(['prefix' => 'suggest'], function () use ($router) {
		// suggest
		$router->get('list', [
			'as' => 'suggestList', 'uses' => '\App\Http\Controllers\Platform\Suggest\SuggestController@list'
		]);
		$router->post('delete', [
			'as' => 'deleteSuggest', 'uses' => '\App\Http\Controllers\Platform\Suggest\SuggestController@delete'
		]);
	});


	// 别名
	$router->group(['prefix' => 'alias'], function () use ($router) {
		// alias
		$router->get('get', [
			'as' => 'getAlias', 'uses' => '\App\Http\Controllers\Platform\Alias\AliasController@get'
		]);
		$router->post('update', [
			'as' => 'updateAlias', 'uses' => '\App\Http\Controllers\Platform\Alias\AliasController@update'
		]);
	});

	// 平台
	$router->group(['prefix' => 'platform/miniapp'], function () use ($router) {
		// 小程序
		$router->get('version/ofProj', [
			'as' => 'getMiniappVersionOfProj', 'uses' => '\App\Http\Controllers\Platform\Miniapp\VersionController@ofProj'
		]);
		$router->get('version/get', [
			'as' => 'getMiniappVersion', 'uses' => '\App\Http\Controllers\Platform\Miniapp\VersionController@get'
		]);
		$router->post('version/create', [
			'as' => 'createMiniappVersion', 'uses' => '\App\Http\Controllers\Platform\Miniapp\VersionController@create'
		]);
		$router->post('version/update', [
			'as' => 'updateMiniappVersion', 'uses' => '\App\Http\Controllers\Platform\Miniapp\VersionController@update'
		]);
		$router->post('version/updateAuditId', [
			'as' => 'updateAuditIdMiniappVersion', 'uses' => '\App\Http\Controllers\Platform\Miniapp\VersionController@updateAuditId'
		]);
		$router->post('version/releaseSuccess', [
			'as' => 'releaseSuccessMiniappVersion', 'uses' => '\App\Http\Controllers\Platform\Miniapp\VersionController@releaseSuccess'
		]);
		$router->post('version/undoCodeAuditSuccess', [
			'as' => 'undoCodeAuditSuccessMiniappVersion', 'uses' => '\App\Http\Controllers\Platform\Miniapp\VersionController@undoCodeAuditSuccess'
		]);
		$router->post('version/delete', [
			'as' => 'deleteMiniappVersion', 'uses' => '\App\Http\Controllers\Platform\Miniapp\VersionController@delete'
		]);
	});
});
